package com.peakchao.webapp;

import android.app.AlertDialog;
import android.webkit.JavascriptInterface;

public class Android2JS extends Object {
    private MainActivity _main;

    public Android2JS(MainActivity main) {
        this._main = main;
    }

    // 定义JS需要调用的方法
    // 被JS调用的方法必须加入@JavascriptInterface注解
    @JavascriptInterface
    public void wxlogin() {
        AlertDialog.Builder alertdialogbuilder = new AlertDialog.Builder(this._main);
        alertdialogbuilder.setMessage("您确认要退出程序");
        alertdialogbuilder.setPositiveButton("确定", null);
        alertdialogbuilder.setNeutralButton("取消", null);
        final AlertDialog alertdialog1 = alertdialogbuilder.create();
        alertdialog1.show();
    }

    @JavascriptInterface
    public void qqlogin() {

    }
}
